<template>
	<view class="page">
		<view class="l-f l-row-c">
			<view class="logo">logo</view>
		</view>
		<view class="desc">AIot OTA </view>
		<view class="title">欢迎回来</view>
		<view class="form">
			<view class="form_item l-f">
				<view>
					<image 
					class="form_item_icon" 
					src="@/static/images/login_user.png" 
					mode="widthFix"></image>
				</view>
				<input 
				class="form_item_input" 
				type="text" 
				placeholder="请输入账号"
				placeholder-style="color: rgba(133, 133, 133, 1);font-size: 26rpx;"
				v-model="userName">
			</view>
			<view class="l-h48"></view>
			<view class="form_item l-f">
				<view>
					<image 
					class="form_item_icon" 
					src="@/static/images/login_password.png" 
					mode="widthFix"></image>
				</view>
				<input 
				class="form_item_input" 
				type="text" 
				placeholder="请输入密码"
				placeholder-style="color: rgba(133, 133, 133, 1);font-size: 26rpx;"
				v-model="passwrod">
			</view>
			<view class="l-h54"></view>
			<view class="l-f l-row-c">
				<view @click="onSubmit" class="form_btn" hover-class="hover-class">登录</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userName: '',
				passwrod: ''
			};
		},
		methods: {
			onSubmit() {
				if(!this.userName) {
					uni.showToast({
						title: '请输入账号',
						icon: 'none'
					})
					return
				}
				if(!this.passwrod) {
					uni.showToast({
						title: '请输入密码',
						icon: 'none'
					})
					return
				}
				uni.switchTab({
					url: '/pages/index/index'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
@import "@/pages/login/login.scss";
</style>
